package org.thread.test05.syn.homework.demo02.test01;

/**
 * @author CSY
 * @date 2025 - 03 - 13
 */
public class PrintInfo {
    public synchronized static void printMsg(User user){
        String[] s= user.getMsg().split("");
        System.out.print(user.getName()+"：");
        for (Integer i = 0;i < s.length;i++){
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.print(s[i]);
        }
    }
}
